#include <sys/types.h>
#include <signal.h>
#include <unistd.h>
#include <iostream>

using namespace std;

void Usage()
{
    cout << "usage:mykill -[signal] [pid]" << endl;
}

// ./mykill pid signal
int main(int argc, char* argv[])
{
    if(argc != 3 || *argv[1] != '-') { Usage(); exit(1); }
    int signal = atoi((const char*)(argv[1] + 1));
    pid_t pid = atoi((const char*)argv[2]);
    if(kill(pid, signal) < 0) { perror("kill err"); exit(2); }
    return 0;
}